createCutoutFromBlocks

abstract fun createCutoutFromBlocks(blocks: List<DesignBlock>, vectorizeDistanceThreshold: Float = 2.0f, simplifyDistanceThreshold: Float = 4.0f, useExistingShapeInformation: Boolean = true): DesignBlock

Create a cutout block whose path will be the contour of the given blocks. The cutout path for each block is derived from one of the two ways:

  • Blocks that have already have a vector path (shapes, SVG-based text or stickers).

  • Blocks that don't have a vector path are vectorized and then, optionally, simplified to eliminate jaggedness (images).

Return

the handle of the created cutout.

Parameters

blocks

the blocks whose shape will serve as the basis for the cutout's path.

vectorizeDistanceThreshold

the maximum number of pixels by which the cutout's path can deviate from the original contour. Default value is 2F.

simplifyDistanceThreshold

the maximum number of pixels by which the simplified cutout path can deviate from the cutout contour. If 0, no simplification step is performed. Default value is 4F.

useExistingShapeInformation

If true, the existing vector paths of the provided blocks will be used to create the cutout. If false, new shape information for the cutout will be generated.